Method and system for internet transport acceleration without protocol offload

ABSTRACT

A packet classifier within a network adapter detects an application packet header belonging to a packet in a data stream associated with an application that uses a network protocol, such as TCP/IP, SNA or IPX. Offsets included within the application header are identified and a plurality of registers is loaded with the identified offsets. Each of a plurality direct data placement patterns are masked with contents of the loaded registers. Each direct data placement pattern is associated with an application packet header and includes a corresponding I/O context. Additionally, each direct data placement pattern includes a corresponding connection path for direct placement of a payload corresponding to the detected application header in a memory that is utilized by the application.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a network system. More particularly,the present invention relates to a system and a method for direct dataplacement of data for an application that uses a network protocol, suchas TCP/IP, SNA and/or IPX

2. Description of the Related Art

Internet protocols, such as TCP/IP, and other networking protocols, suchas SNA and IPX, are crucial to the performance of many applications. Thevast majority of communication protocols for current applications useTCP/IP as the transport protocol. Consequently, both researchers andpractitioners have focused on performance improvements for TCP/IP.

The most popular conventional approach for improving TCP/IP performanceis to offload the entire TCP/IP stack onto a network adapter. See, forexample, U.S. Pat. No. 6,434,620B1 to L. B. Boucher et al. and U.S.Patent Application 2002/016191 A1 to L. B. Boucher et al. Offloading theentire TCP/IP stack onto a network adapter has many advantages. Forexample, interrupt overhead for the host processor is reduced becausethere is only one interrupt per TCP message as opposed to one interruptfor each TCP segment. Offloading the entire TCP/IP stack also relievesthe burden of TCP/IP processing from the host processor, particularlythe copy-and-checksum processing overheads, and saves precious CPUcycles. Further, offloading the TCP/IP stack provides the opportunityfor direct data placement on the receive path based on applicationheader processing on the network adapter.

A drawback of offloading the TCP/IP stack onto a network adapter,however, is that the processing power of a network adapter is notcomparable to the processing power of a general purpose CPU and suchoffloading may cause bottlenecks. Recent studies have shown that theperformance of the TCP/IP offload adapters is sometimes behind that of asoftware TCP/IP stack.

Consequently, what is needed is a technique for direct data placement ofdata for a TCP/IP application without offloading the protocol onto anetwork adapter.

BRIEF SUMMARY OF THE INVENTION

The present invention provides a technique for direct data placement ofdata for a TCP/IP application without offloading the protocol onto anetwork adapter.

The advantages of the present invention are provided by a system andmethod for direct data placement of data for an application that uses anetwork protocol, such as TCP/IP, SNA or IPX. According to theinvention, an application packet header is detected using a packetclassifier within a network adapter. The application packet headerbelongs to a packet in a data stream associated with the application.Offsets included within the application header are then identified and aplurality of registers is loaded with the identified offsets. Each of aplurality direct data placement patterns are masked with contents of theloaded registers. Direct data placement of data associated with theapplication packet header is initiated when a result of masking a set ofvalues corresponding to a direct data placement pattern with contents ofthe loaded registers matches one of at least one direct data placementpattern. Each direct data placement pattern is associated with anapplication packet header and includes a corresponding I/O context.Additionally, each direct data placement pattern includes acorresponding connection path for direct placement of a payloadcorresponding to the detected application header in a memory that isutilized by the application.

When direct data placement is initiated, information corresponding tothe detected application header is extracted and the data payload of thedetected applications header is DMA-ed to registered memory that isassociated with the application, based on the direct data placementpattern. Only one interrupt of a host processor for the network adapteris generated for each message. Moreover, when direct data placement ofdata associated with the application packet header is initiated, a hostprocessor for the network adapter does not perform copy and checksumprocessing.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and not bylimitation in the accompanying figures in which like reference numeralsindicate similar elements and in which:

FIG. 1 shows a functional block diagram of a computer system having anetwork adapter with a packet classifier according to the presentinvention; and

FIG. 2 show a flowchart of a process for accelerating TCP/IPapplications without offloading the TCP/IP stack onto a network adapteraccording to the present invention.

DETAILED DESCRIPTION OF THE INVENTION

The present invention provides a technique for accelerating TCP/IPapplications without offloading the TCP/IP stack onto a network adapter.Instead, the present invention offloads application-programmableintelligence onto a network adapter that provides a programmable packetclassifier for direct data placement for TCP applications, therebyproviding most of the benefits associated with conventional offloadingof the TCP/IP stack to a network adapter.

The present invention provides many advantages. For example, systeminterrupts are reduced because the system is interrupted only on thetransfer of data and not for every incoming TCP/IP packet. Additionally,TCP/IP copy overhead is eliminated because the programmable interfacedoes direct data placement based on the classifier recognizingapplication headers. Moreover, direct data placement is an inbuiltadvantage of the present invention.

While the present invention is as advantageous as a conventional systemthat offloads TCP/IP stack processing, the present invention providestwo additional benefits over such conventional systems. First, thecomplexity of the programmable packet classifier of the presentinvention is much less than the complexity of the entire TCP/IP stack.Consequently, a network adapter having a programmable packet classifierof the present invention is less costly. Second, the present inventionleaves TCP/IP processing on the host processor, thereby allowing theperformance to scale with CPU speeds.

FIG. 1 shows a functional block diagram of a computer system 100 havinga network adapter with a packet classifier according to the presentinvention. Computer system 100 includes a host processor 101, a TCP/IPstack 102 and a network adapter 103. Network adapter 103 includes apacket classifier 104 having a programming interface 105, and isconnected to network 106, such as an Ethernet.

Programming interface 105 for packet classifier 104 includes aprogrammable interface that is programmed by a TCP/IP application. Thefirst programmable parameter is a set of registers R that contain valuesthat are to be loaded from a TCP stream. The second programmableparameter is the set of offsets O that indicate where the values loadedinto registers R are located in the application header. The thirdprogrammable parameter is a set of masks M that are applied to thecontents of registers R. The fourth programmable parameter is a set ofvalues V that are to be matched with the results of masking the contentsof registers R masked with the contents of masks M. The fifthprogrammable parameter is the action A that is to be taken when apattern is matched. Action A can have additional associated parametersdepending on the action taken. The application separately programs acache of I/O tags to reserved memory RM for each corresponding I/O tagin a well-known manner.

The present invention requires that the TCP stream has applicationheader synchronization. Additionally, the present invention does notprovide application header resynchronization because loss of applicationheader synchronization is usually handled by protocol action, such as bymarkers, or by breaking down the connection.

FIG. 2 show a flowchart 200 of a process for accelerating TCP/IPapplications without offloading the TCP/IP stack onto a network adapteraccording to the present invention. At step 201, a TCP/IP applicationprograms the R, O, M, V and A programmable parameters of packetclassifier 104. At step 202, TCP/IP communications are monitor by packetclassifier 104 and it is determined whether an application header isdetected. If not, flow remains at step 202. Otherwise, when packetclassifier detects an application header, flow continues to step 203where packet classifier 104 loads registers R from offsets O in thedetected header and at step 204 masks values V with the contents ofregisters R. At step 205, it is determined whether the results of themasking match the results with a corresponding programmed pattern. Whenthe results of the masking match a programmed patterned, flow continuesto step 206 where packet classifier 104 takes action A that is specifiedin the pattern. When action A involves direct data placement, headinformation (i.e., I/O tags and protocol details) are extracted forDMA-ing the data payload of the of the application header to reservedmemory RM associated with the application. For example, when an I/O tagcorresponds to reserved memory RM1-RM2, action A involves moving thecontents of TCP sequence numbers S1-S2 to RM1-RM2. Flow continues tostep 202.

If, at step 205, the results of the masking do not match a programmedpattern, then flow continues to step 207 where it is determined whetherthere are no TCP header in incoming packets because there is IPfragmentation. If so, then flow continues to step 208 where the task ofmoving the contents of TCP sequence numbers is hindered by thefragmentation and is best done through action A′ in which additionalprogramming of registers R′, masks M′, values V′ and offsets O′ is doneto map the fragmented IP headers to the TCP stream. Flow continues tostep 202.

If at step 207, IP fragmentation is not detected, flow continues to step209 where the incoming TCP/IP packets doe not match any pattern becausethere are out-of-order packets causing missing application headers. Atstep 209, the incoming TCP/IP packets are sent directly to the hostTCP/IP stack for processing. At this point, the TCP/IP packet issubjected to the copy-and-checksum overhead. Alternatively, theout-of-order packets are buffered in network adapter 103. For high datarates, though, this alternative increases the memory requirements ofnetwork adapter 103.

While the present invention has been described using TCP/IP as anexemplary network protocol, it should be understood that the presentinvention is applicable for other network protocols, such as SNA or IPX.

Although the foregoing invention has been described in some detail forpurposes of clarity of understanding, it will be apparent that certainchanges and modifications may be practiced that are within the scope ofthe appended claims. Accordingly, the present embodiments are to beconsidered as illustrative and not restrictive, and the invention is notto be limited to the details given herein, but may be modified withinthe scope and equivalents of the appended claims.

1. A method for direct data placement of data for an application thatuses a network protocol, the method comprising: detecting an applicationpacket header using a packet classifier within a network adapter, theapplication packet header belonging to a packet in a data streamassociated with the application; identifying offsets included within theapplication header; loading a plurality of registers with the identifiedoffsets; initiating direct data placement of data associated with theapplication packet header when a result of masking a set of valuescorresponding to a direct data placement pattern with contents of theloaded registers matches one of at least one direct data placementpattern, each direct data placement pattern being associated with anapplication packet header.
 2. The method according to claim 1, wherein aplurality of direct data placement patterns are available for maskingwith the contents of the loaded registers.
 3. The method according toclaim 2, further comprising masking each of the plurality direct dataplacement patterns with contents of the loaded registers.
 4. The methodaccording to claim 1, wherein each direct data placement patternincludes a corresponding I/O context.
 5. The method according to claim1, wherein each direct data placement pattern includes a correspondingconnection path for direct placement of a payload corresponding to thedetected application header in a memory that is utilized by theapplication.
 6. The method according to claim 1, wherein initiatingdirect data placement includes: extracting information corresponding tothe detected application header; and mapping a payload of the detectedapplications header to a memory based on the direct data placementpattern.
 7. The method according to claim 6, wherein the memory is apredetermined region of memory associated with the application.
 8. Themethod according to claim 1, further comprising generating only oneinterrupt of a host processor for the network adapter for each message.9. The method according to claim 1, wherein when initiating direct dataplacement of data associated with the application packet header isperformed, a host processor for the network adapter does not performcopy and checksum processing.
 10. The method according to claim 1,wherein the network protocol is TCP/IP.
 11. The method according toclaim 1, wherein the network protocol is SNA.
 12. The method accordingto claim 1, wherein the network protocol is IPX.
 13. A network adapter,comprising: an interface to a protocol-based network; and a packetclassifier, the packet classifier detecting an application packetheader, the application packet header belonging to a packet in a datastream associated with an application that uses the protocol, the packetclassifier identifying offsets included within the application header,loading a plurality of registers with the identified offsets, andinitiating direct data placement of data associated with the applicationpacket header when a result of masking a set of values corresponding toa direct data placement pattern with contents of the loaded registersmatches one of at least one direct data placement pattern, each directdata placement pattern being associated with an application packetheader.
 14. The network adapter according to claim 13, wherein aplurality of direct data placement patterns are available for maskingwith the contents of the loaded registers.
 15. The network adapteraccording to claim 14, wherein the packet classifier masks each of theplurality direct data placement patterns with contents of the loadedregisters.
 16. The network adapter according to claim 13, wherein eachdirect data placement pattern includes a corresponding I/O context. 17.The network adapter according to claim 13, wherein each direct dataplacement pattern includes a corresponding connection path for directplacement of a payload corresponding to the detected application headerin a memory that is utilized by the application.
 18. The network adapteraccording to claim 13, wherein when the packet classifier initiatesdirect data placement, the packet classifier extracts informationcorresponding to the detected application header and DMA-s a payload ofthe detected applications header to a memory based on the direct dataplacement pattern.
 19. The network adapter according to claim 18,wherein the memory is a predetermined region of memory associated withthe application.
 20. The network adapter according to claim 13, whereinthe packet classifier generates only one interrupt of a host processorfor the network adapter for each TCP message.
 21. The network adapteraccording to claim 13, wherein when the packet classifier initiatesdirect data placement of data associated with the application packetheader is performed, a host processor for the network adapter does notperform copy and checksum processing.
 22. The network according to claim13, wherein the network protocol is TCP/IP.
 23. The network according toclaim 13, wherein the network protocol is SNA.
 24. The network accordingto claim 13, wherein the network protocol is IPX.